
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>HTTPS设置 · InfluxDB中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="jasper">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-comment/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../Concepts/" />
    
    
    <link rel="prev" href="hardware_sizing.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://legacy.gitbook.com/book/jasper-zhang1/influxdb" target="_blank" class="custom-link">InfluxDB中文文档</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Introduction/">
            
                <a href="../Introduction/">
            
                    
                    介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Introduction/installation.html">
            
                <a href="../Introduction/installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Introduction/getting_start.html">
            
                <a href="../Introduction/getting_start.html">
            
                    
                    入门指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    使用指南
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="writing_data.html">
            
                <a href="writing_data.html">
            
                    
                    写入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="querying_data.html">
            
                <a href="querying_data.html">
            
                    
                    查询数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="downsampling_and_retention.html">
            
                <a href="downsampling_and_retention.html">
            
                    
                    采样和数据保留
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="hardware_sizing.html">
            
                <a href="hardware_sizing.html">
            
                    
                    硬件指南
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.5" data-path="https_setup.html">
            
                <a href="https_setup.html">
            
                    
                    HTTPS设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../Concepts/">
            
                <a href="../Concepts/">
            
                    
                    概念介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../Concepts/key_concepts.html">
            
                <a href="../Concepts/key_concepts.html">
            
                    
                    关键概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../Concepts/glossary.html">
            
                <a href="../Concepts/glossary.html">
            
                    
                    专业术语
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../Concepts/crosswalk.html">
            
                <a href="../Concepts/crosswalk.html">
            
                    
                    与SQL比较
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../Concepts/insights_tradeoffs.html">
            
                <a href="../Concepts/insights_tradeoffs.html">
            
                    
                    InfluxDB的设计见解和权衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../Concepts/schema_and_data_layout.html">
            
                <a href="../Concepts/schema_and_data_layout.html">
            
                    
                    schema设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../Concepts/storage_engine.html">
            
                <a href="../Concepts/storage_engine.html">
            
                    
                    存储引擎
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Write_protocols/">
            
                <a href="../Write_protocols/">
            
                    
                    写入协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Write_protocols/line_protocol.html">
            
                <a href="../Write_protocols/line_protocol.html">
            
                    
                    行协议
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Query_language/">
            
                <a href="../Query_language/">
            
                    
                    查询语言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Query_language/data_exploration.html">
            
                <a href="../Query_language/data_exploration.html">
            
                    
                    数据查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Query_language/schema_exploration.html">
            
                <a href="../Query_language/schema_exploration.html">
            
                    
                    schema查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../Query_language/database_management.html">
            
                <a href="../Query_language/database_management.html">
            
                    
                    数据库管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../Query_language/continuous_queries.html">
            
                <a href="../Query_language/continuous_queries.html">
            
                    
                    连续查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../Query_language/functions.html">
            
                <a href="../Query_language/functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../Query_language/math_operators.html">
            
                <a href="../Query_language/math_operators.html">
            
                    
                    数学运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../Query_language/authentication_and_authorization.html">
            
                <a href="../Query_language/authentication_and_authorization.html">
            
                    
                    认证和授权
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../Troubleshooting/">
            
                <a href="../Troubleshooting/">
            
                    
                    故障排除
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../Troubleshooting/faq.html">
            
                <a href="../Troubleshooting/faq.html">
            
                    
                    FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../Troubleshooting/system_monitor.html">
            
                <a href="../Troubleshooting/system_monitor.html">
            
                    
                    系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../Troubleshooting/query_management.html">
            
                <a href="../Troubleshooting/query_management.html">
            
                    
                    查询管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../Troubleshooting/error_messages.html">
            
                <a href="../Troubleshooting/error_messages.html">
            
                    
                    错误信息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >HTTPS设置</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="https&#x8BBE;&#x7F6E;">HTTPS&#x8BBE;&#x7F6E;</h1>
<p>&#x8FD9;&#x7BC7;&#x63CF;&#x8FF0;&#x4E86;&#x600E;&#x6837;&#x5728;InfluxDB&#x4E2D;&#x5F00;&#x542F;HTTPS&#x3002;&#x8BBE;&#x7F6E;HTTPS&#x53EF;&#x4EE5;&#x4FDD;&#x62A4;&#x5BA2;&#x6237;&#x7AEF;&#x548C;InfluxDB&#x670D;&#x52A1;&#x5668;&#x4E4B;&#x95F4;&#x7684;&#x901A;&#x4FE1;&#xFF0C;&#x5728;&#x67D0;&#x4E9B;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;HTTPS&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x9A8C;&#x8BC1;InfluxDB&#x670D;&#x52A1;&#x5668;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x771F;&#x5B9E;&#x6027;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x8BA1;&#x5212;&#x901A;&#x8FC7;&#x7F51;&#x7EDC;&#x6765;&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x5230;InfluxDB&#xFF0C;&#x6211;&#x4EEC;&#x5F3A;&#x70C8;&#x5EFA;&#x8BAE;&#x4F60;&#x5F00;&#x542F;HTTPS&#x3002;</p>
<h2 id="&#x51C6;&#x5907;">&#x51C6;&#x5907;</h2>
<p>&#x4E3A;&#x4E86;&#x7ED9;InfluxDB&#x4E0A;&#x8BBE;&#x7F6E;HTTPS&#xFF0C;&#x4F60;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x5DF2;&#x6709;&#x7684;&#x6216;&#x662F;&#x65B0;&#x5EFA;&#x7684;InfluxDB&#x5B9E;&#x4F8B;&#xFF0C;&#x8FD8;&#x9700;&#x8981;TLS&#x8BC1;&#x4E66;&#x4E5F;&#x53EF;&#x4EE5;&#x8BF4;SSL&#x8BC1;&#x4E66;&#x3002;InfluxDB&#x652F;&#x6301;&#x4E09;&#x79CD;&#x7C7B;&#x578B;&#x7684;TLS/SSL&#x8BC1;&#x4E66;&#xFF1A;</p>
<ul>
<li><p><strong>&#x7531;&#x8BC1;&#x4E66;&#x9881;&#x53D1;&#x673A;&#x6784;&#x7B7E;&#x540D;&#x7684;&#x5355;&#x57DF;&#x8BC1;&#x4E66;</strong><br>&#x8FD9;&#x4E9B;&#x8BC1;&#x4E66;&#x4E3A;HTTPS&#x8BF7;&#x6C42;&#x63D0;&#x4F9B;&#x52A0;&#x5BC6;&#x5B89;&#x5168;&#x6027;&#xFF0C;&#x5E76;&#x5141;&#x8BB8;&#x5BA2;&#x6237;&#x7AEF;&#x9A8C;&#x8BC1;InfluxDB&#x670D;&#x52A1;&#x5668;&#x7684;&#x8EAB;&#x4EFD;&#x3002; &#x5982;&#x679C;&#x4F7F;&#x7528;&#x6B64;&#x8BC1;&#x4E66;&#xFF0C;&#x6BCF;&#x4E2A;InfluxDB&#x5B9E;&#x4F8B;&#x90FD;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x552F;&#x4E00;&#x7684;&#x5355;&#x57DF;&#x8BC1;&#x4E66;&#x3002;</p>
</li>
<li><p><strong>&#x8BC1;&#x4E66;&#x9881;&#x53D1;&#x673A;&#x6784;&#x7B7E;&#x53D1;&#x7684;&#x901A;&#x914D;&#x8BC1;&#x4E66;</strong><br>&#x8FD9;&#x4E9B;&#x8BC1;&#x4E66;&#x4E3A;HTTPS&#x8BF7;&#x6C42;&#x63D0;&#x4F9B;&#x52A0;&#x5BC6;&#x5B89;&#x5168;&#x6027;&#xFF0C;&#x5E76;&#x5141;&#x8BB8;&#x5BA2;&#x6237;&#x7AEF;&#x9A8C;&#x8BC1;InfluxDB&#x670D;&#x52A1;&#x5668;&#x7684;&#x8EAB;&#x4EFD;&#x3002; &#x53EF;&#x4EE5;&#x5728;&#x4E0D;&#x540C;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684;&#x591A;&#x4E2A;InfluxDB&#x5B9E;&#x4F8B;&#x4E2D;&#x4F7F;&#x7528;&#x901A;&#x914D;&#x7B26;&#x8BC1;&#x4E66;&#x3002;</p>
</li>
<li><p><strong>&#x81EA;&#x7B7E;&#x8BC1;&#x4E66;</strong><br>&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x4E0D;&#x7531;CA&#x7B7E;&#x540D;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x5728;&#x81EA;&#x5DF1;&#x7684;&#x673A;&#x5668;&#x4E0A;&#x751F;&#x6210;&#x3002; &#x4E0E;CA&#x7B7E;&#x7F72;&#x7684;&#x8BC1;&#x4E66;&#x4E0D;&#x540C;&#xFF0C;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x4EC5;&#x4E3A;HTTPS&#x8BF7;&#x6C42;&#x63D0;&#x4F9B;&#x52A0;&#x5BC6;&#x5B89;&#x5168;&#x6027;&#x3002; &#x4ED6;&#x4EEC;&#x4E0D;&#x5141;&#x8BB8;&#x5BA2;&#x6237;&#x7AEF;&#x9A8C;&#x8BC1;InfluxDB&#x670D;&#x52A1;&#x5668;&#x7684;&#x8EAB;&#x4EFD;&#x3002; &#x5982;&#x679C;&#x60A8;&#x65E0;&#x6CD5;&#x83B7;&#x5F97;CA&#x7B7E;&#x53D1;&#x7684;&#x8BC1;&#x4E66;&#xFF0C;&#x6211;&#x4EEC;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x3002; &#x5982;&#x679C;&#x4F7F;&#x7528;&#x6B64;&#x8BC1;&#x4E66;&#xFF0C;&#x6BCF;&#x4E2A;InfluxDB&#x5B9E;&#x4F8B;&#x90FD;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x552F;&#x4E00;&#x7684;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x3002;</p>
</li>
</ul>
<p>&#x65E0;&#x8BBA;&#x60A8;&#x7684;&#x8BC1;&#x4E66;&#x7C7B;&#x578B;&#x5982;&#x4F55;&#xFF0C;InfluxDB&#x90FD;&#x652F;&#x6301;&#x7531;&#x79C1;&#x94A5;&#x6587;&#x4EF6;&#xFF08;.key&#xFF09;&#x548C;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF08;.crt&#xFF09;&#x6587;&#x4EF6;&#x5BF9;&#x7EC4;&#x6210;&#x7684;&#x8BC1;&#x4E66;&#xFF0C;&#x4EE5;&#x53CA;&#x5C06;&#x79C1;&#x94A5;&#x6587;&#x4EF6;&#x548C;&#x7B7E;&#x540D;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x7EC4;&#x5408;&#x6210;&#x4E00;&#x4E2A;&#x6346;&#x7ED1;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF08;.pem&#xFF09;&#x3002;</p>
<p>&#x4EE5;&#x4E0B;&#x4E24;&#x90E8;&#x5206;&#x5C06;&#x4ECB;&#x7ECD;&#x5728;Ubuntu 16.04&#x4E0A;&#x5982;&#x4F55;&#x4F7F;&#x7528;CA&#x7B7E;&#x53D1;&#x7684;&#x8BC1;&#x4E66;&#x548C;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x7ED9;InfluxDB&#x8BBE;&#x7F6E;HTTPS&#x3002;&#x5176;&#x4ED6;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x5177;&#x4F53;&#x6B65;&#x9AA4;&#x53EF;&#x80FD;&#x4E0D;&#x540C;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;ca&#x7B7E;&#x53D1;&#x7684;&#x8BC1;&#x4E66;&#x8BBE;&#x7F6E;https">&#x4F7F;&#x7528;CA&#x7B7E;&#x53D1;&#x7684;&#x8BC1;&#x4E66;&#x8BBE;&#x7F6E;HTTPS</h2>
<h3 id="&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x5B89;&#x88C5;ssl--tls&#x8BC1;&#x4E66;">&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x5B89;&#x88C5;SSL / TLS&#x8BC1;&#x4E66;</h3>
<p>&#x5C06;&#x79C1;&#x94A5;&#x6587;&#x4EF6;&#xFF08;.key&#xFF09;&#x548C;&#x7B7E;&#x540D;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF08;.crt&#xFF09;&#x6216;&#x5355;&#x4E2A;&#x6346;&#x7ED1;&#x6587;&#x4EF6;&#xFF08;.pem&#xFF09;&#x653E;&#x5728;<code>/etc/ssl</code>&#x76EE;&#x5F55;&#x4E2D;&#x3002;</p>
<h3 id="&#x7B2C;&#x4E8C;&#x6B65;&#xFF1A;&#x786E;&#x4FDD;&#x6587;&#x4EF6;&#x6743;&#x9650;">&#x7B2C;&#x4E8C;&#x6B65;&#xFF1A;&#x786E;&#x4FDD;&#x6587;&#x4EF6;&#x6743;&#x9650;</h3>
<p>&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x9700;&#x8981;root&#x7528;&#x6237;&#x7684;&#x8BFB;&#x5199;&#x6743;&#x9650;&#x3002;&#x901A;&#x8FC7;&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x786E;&#x4FDD;&#x60A8;&#x5177;&#x6709;&#x6B63;&#x786E;&#x7684;&#x6587;&#x4EF6;&#x6743;&#x9650;&#xFF1A;</p>
<pre><code>sudo chown root:root /etc/ssl/&lt;CA-certificate-file&gt;
sudo chmod 644 /etc/ssl/&lt;CA-certificate-file&gt;
sudo chmod 600 /etc/ssl/&lt;private-key-file&gt;
</code></pre><h3 id="&#x7B2C;&#x4E09;&#x6B65;&#xFF1A;&#x5728;influxdb&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5F00;&#x542F;https">&#x7B2C;&#x4E09;&#x6B65;&#xFF1A;&#x5728;InfluxDB&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5F00;&#x542F;HTTPS</h3>
<p>&#x9ED8;&#x8BA4;HTTPS&#x662F;&#x5173;&#x95ED;&#x7684;&#xFF0C;&#x5728;InfluxDB&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;<code>/etc/influxdb/influxdb.conf</code>&#x7684;<code>[http]</code>&#x90E8;&#x5206;&#x901A;&#x8FC7;&#x5982;&#x4E0B;&#x8BBE;&#x7F6E;&#x5F00;&#x542F;HTTPS&#xFF1A;</p>
<ul>
<li><code>https-enabled</code>&#x8BBE;&#x4E3A;<code>true</code></li>
<li><code>http-certificate</code>&#x8BBE;&#x4E3A;<code>/etc/ssl/&lt;signed-certificate-file&gt;.crt</code>(&#x6216;&#x8005;<code>/etc/ssl/&lt;bundled-certificate-file&gt;.pem</code>)</li>
<li><code>http-private-key</code>&#x8BBE;&#x4E3A;<code>/etc/ssl/&lt;private-key-file&gt;.key</code>(&#x6216;&#x8005;<code>/etc/ssl/&lt;bundled-certificate-file&gt;.pem</code>)</li>
</ul>
<pre><code>[http]

  [...]

  # Determines whether HTTPS is enabled.
  https-enabled = true

  [...]

  # The SSL certificate to use when HTTPS is enabled.
  https-certificate = &quot;&lt;bundled-certificate-file&gt;.pem&quot;

  # Use a separate private key location.
  https-private-key = &quot;&lt;bundled-certificate-file&gt;.pem&quot;
</code></pre><h3 id="&#x7B2C;&#x56DB;&#x6B65;&#xFF1A;&#x91CD;&#x542F;influxdb">&#x7B2C;&#x56DB;&#x6B65;&#xFF1A;&#x91CD;&#x542F;InfluxDB</h3>
<p>&#x91CD;&#x542F;InfluxDB&#x4F7F;&#x914D;&#x7F6E;&#x751F;&#x6548;&#xFF1A;</p>
<pre><code>sudo systemctl restart influxdb
</code></pre><h3 id="&#x7B2C;&#x4E94;&#x6B65;&#xFF1A;&#x9A8C;&#x8BC1;https&#x5B89;&#x88C5;">&#x7B2C;&#x4E94;&#x6B65;&#xFF1A;&#x9A8C;&#x8BC1;HTTPS&#x5B89;&#x88C5;</h3>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;InfluxDB&#x7684;CLI&#x6765;&#x9A8C;&#x8BC1;HTTPS&#x662F;&#x5426;&#x5DE5;&#x4F5C;&#xFF1A;</p>
<pre><code>influx -ssl -host &lt;domain_name&gt;.com
</code></pre><p>&#x5982;&#x679C;&#x8FDE;&#x63A5;&#x6210;&#x529F;&#x4F1A;&#x8FD4;&#x56DE;&#xFF1A;</p>
<pre><code>Connected to https://&lt;domain_name&gt;.com:8086 version 1.x.x
InfluxDB shell version: 1.x.x
&gt;
</code></pre><p>&#x8FD9;&#x6837;&#x4F60;&#x5C31;&#x6210;&#x529F;&#x5F00;&#x542F;&#x4E86;InfluxDB&#x7684;HTTPS&#x4E86;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x8BBE;&#x7F6E;https">&#x4F7F;&#x7528;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x8BBE;&#x7F6E;HTTPS</h2>
<h3 id="&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x751F;&#x6210;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;">&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x751F;&#x6210;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;</h3>
<p>&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x751F;&#x6210;&#x79C1;&#x6709;&#x5BC6;&#x94A5;&#x6587;&#x4EF6;&#xFF08;.key&#xFF09;&#x548C;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF08;.crt&#xFF09;&#xFF0C;&#x8BE5;&#x6587;&#x4EF6;&#x5BF9;&#x4E8E;&#x6307;&#x5B9A;<code>NUMBER_OF_DAYS</code>&#x60C5;&#x51B5;&#x4E0B;&#x4ECD;&#x7136;&#x6709;&#x6548;&#x3002; &#x5B83;&#x5C06;&#x8FD9;&#x4E9B;&#x6587;&#x4EF6;&#x8F93;&#x51FA;&#x5230;InfluxDB&#x7684;&#x9ED8;&#x8BA4;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;&#xFF0C;&#x5E76;&#x5411;&#x4ED6;&#x4EEC;&#x63D0;&#x4F9B;&#x6240;&#x9700;&#x7684;&#x6743;&#x9650;&#x3002;</p>
<pre><code>sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ssl/influxdb-selfsigned.key -out /etc/ssl/influxdb-selfsigned.crt -days &lt;NUMBER_OF_DAYS&gt;
</code></pre><p>&#x5F53;&#x6267;&#x884C;&#x8BE5;&#x547D;&#x4EE4;&#x65F6;&#xFF0C;&#x5C06;&#x63D0;&#x793A;&#x60A8;&#x63D0;&#x4F9B;&#x66F4;&#x591A;&#x4FE1;&#x606F;&#x3002; &#x60A8;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x586B;&#x5199;&#x8BE5;&#x4FE1;&#x606F;&#x6216;&#x5C06;&#x5176;&#x7559;&#x7A7A;; &#x8FD9;&#x4E24;&#x4E2A;&#x64CD;&#x4F5C;&#x90FD;&#x4F1A;&#x751F;&#x6210;&#x6709;&#x6548;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x3002;</p>
<h3 id="&#x7B2C;&#x4E8C;&#x6B65;&#xFF1A;&#x5728;influxdb&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5F00;&#x542F;https">&#x7B2C;&#x4E8C;&#x6B65;&#xFF1A;&#x5728;InfluxDB&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5F00;&#x542F;HTTPS</h3>
<p>&#x9ED8;&#x8BA4;HTTPS&#x662F;&#x5173;&#x95ED;&#x7684;&#xFF0C;&#x5728;InfluxDB&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;<code>/etc/influxdb/influxdb.conf</code>&#x7684;<code>[http]</code>&#x90E8;&#x5206;&#x901A;&#x8FC7;&#x5982;&#x4E0B;&#x8BBE;&#x7F6E;&#x5F00;&#x542F;HTTPS&#xFF1A;</p>
<ul>
<li><code>https-enabled</code>&#x8BBE;&#x4E3A;<code>true</code></li>
<li><code>http-certificate</code>&#x8BBE;&#x4E3A;<code>/etc/ssl/influxdb-selfsigned.crt</code></li>
<li><code>http-private-key</code>&#x8BBE;&#x4E3A;<code>/etc/ssl/influxdb-selfsigned.key</code></li>
</ul>
<pre><code>[http]

  [...]

  # Determines whether HTTPS is enabled.
  https-enabled = true

  [...]

  # The SSL certificate to use when HTTPS is enabled.
  https-certificate = &quot;/etc/ssl/influxdb-selfsigned.crt&quot;

  # Use a separate private key location.
  https-private-key = &quot;/etc/ssl/influxdb-selfsigned.key&quot;
</code></pre><h3 id="&#x7B2C;&#x4E09;&#x6B65;&#xFF1A;&#x91CD;&#x542F;influxdb">&#x7B2C;&#x4E09;&#x6B65;&#xFF1A;&#x91CD;&#x542F;InfluxDB</h3>
<p>&#x91CD;&#x542F;InfluxDB&#x4F7F;&#x914D;&#x7F6E;&#x751F;&#x6548;&#xFF1A;</p>
<pre><code>sudo systemctl restart influxdb
</code></pre><h3 id="&#x7B2C;&#x56DB;&#x6B65;&#xFF1A;&#x9A8C;&#x8BC1;https&#x5B89;&#x88C5;">&#x7B2C;&#x56DB;&#x6B65;&#xFF1A;&#x9A8C;&#x8BC1;HTTPS&#x5B89;&#x88C5;</h3>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;InfluxDB&#x7684;CLI&#x6765;&#x9A8C;&#x8BC1;HTTPS&#x662F;&#x5426;&#x5DE5;&#x4F5C;&#xFF1A;</p>
<pre><code>influx -ssl -unsafeSsl -host &lt;domain_name&gt;.com
</code></pre><p>&#x5982;&#x679C;&#x8FDE;&#x63A5;&#x6210;&#x529F;&#x4F1A;&#x8FD4;&#x56DE;&#xFF1A;</p>
<pre><code>Connected to https://&lt;domain_name&gt;.com:8086 version 1.x.x
InfluxDB shell version: 1.x.x
&gt;
</code></pre><blockquote>
<h4 id="&#x5C06;telegraf&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x4E2A;&#x5B89;&#x5168;&#x7684;influxdb&#x5B9E;&#x4F8B;">&#x5C06;Telegraf&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x4E2A;&#x5B89;&#x5168;&#x7684;InfluxDB&#x5B9E;&#x4F8B;</h4>
<p>&#x5C06;Telegraf&#x8FDE;&#x63A5;&#x5230;&#x4F7F;&#x7528;HTTPS&#x7684;InfluxDB&#x5B9E;&#x4F8B;&#x9700;&#x8981;&#x4E00;&#x4E9B;&#x989D;&#x5916;&#x7684;&#x6B65;&#x9AA4;&#x3002; </p>
<p>&#x5728;Telegraf&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF08;<code>/etc/telegraf/telegraf.conf</code>&#xFF09;&#x4E2D;&#xFF0C;&#x7F16;&#x8F91;<code>urls</code>&#x8BBE;&#x7F6E;&#x4EE5;&#x6307;&#x5B9A;<code>https</code>&#x800C;&#x4E0D;&#x662F;<code>http</code>&#xFF0C;&#x5E76;&#x5C06;<code>localhost</code>&#x66F4;&#x6539;&#x4E3A;&#x76F8;&#x5173;&#x57DF;&#x540D;&#x3002; &#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528;&#x81EA;&#x7B7E;&#x540D;&#x8BC1;&#x4E66;&#xFF0C;&#x8BF7;&#x53D6;&#x6D88;<code>insecure_skip_verify</code>&#x7684;&#x6CE8;&#x91CA;&#x8BBE;&#x7F6E;&#x5E76;&#x5C06;&#x5176;&#x8BBE;&#x7F6E;&#x4E3A;true&#x3002;</p>
</blockquote>
<pre><code>###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################

# Configuration for influxdb server to send metrics to
[[outputs.influxdb]]
  ## The full HTTP or UDP endpoint URL for your InfluxDB instance.
  ## Multiple urls can be specified as part of the same cluster,
  ## this means that only ONE of the urls will be written to each interval.
  # urls = [&quot;udp://localhost:8089&quot;] # UDP endpoint example
  urls = [&quot;https://&lt;domain_name&gt;.com:8086&quot;]

[...]

  ## Optional SSL Config
  [...]
  insecure_skip_verify = true # &lt;-- Update only if you&apos;re using a self-signed certificate
</code></pre><blockquote>
<p>&#x7136;&#x540E;&#x91CD;&#x542F;Telegraf&#x5C31;&#x53EF;&#x4EE5;&#x5566;&#xFF01;</p>
</blockquote>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="hardware_sizing.html" class="navigation navigation-prev " aria-label="Previous page: 硬件指南">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../Concepts/" class="navigation navigation-next " aria-label="Next page: 概念介绍">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"HTTPS设置","level":"1.3.5","depth":2,"next":{"title":"概念介绍","level":"1.4","depth":1,"path":"Concepts/index.md","ref":"Concepts/index.md","articles":[{"title":"关键概念","level":"1.4.1","depth":2,"path":"Concepts/key_concepts.md","ref":"Concepts/key_concepts.md","articles":[]},{"title":"专业术语","level":"1.4.2","depth":2,"path":"Concepts/glossary.md","ref":"Concepts/glossary.md","articles":[]},{"title":"与SQL比较","level":"1.4.3","depth":2,"path":"Concepts/crosswalk.md","ref":"Concepts/crosswalk.md","articles":[]},{"title":"InfluxDB的设计见解和权衡","level":"1.4.4","depth":2,"path":"Concepts/insights_tradeoffs.md","ref":"Concepts/insights_tradeoffs.md","articles":[]},{"title":"schema设计","level":"1.4.5","depth":2,"path":"Concepts/schema_and_data_layout.md","ref":"Concepts/schema_and_data_layout.md","articles":[]},{"title":"存储引擎","level":"1.4.6","depth":2,"path":"Concepts/storage_engine.md","ref":"Concepts/storage_engine.md","articles":[]}]},"previous":{"title":"硬件指南","level":"1.3.4","depth":2,"path":"Guide/hardware_sizing.md","ref":"Guide/hardware_sizing.md","articles":[]},"dir":"ltr"},"config":{"plugins":["comment"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"comment":{"highlightCommented":true},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"jasper-zhang/influxdb-document-cn","theme":"default","author":"jasper","pdf":{"pageNumbers":true,"fontSize":16,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"InfluxDB中文文档","language":"en","links":{"sidebar":{"InfluxDB中文文档":"https://legacy.gitbook.com/book/jasper-zhang1/influxdb"},"gitbook":true},"gitbook":"*","description":""},"file":{"path":"Guide/https_setup.md","mtime":"2019-09-29T09:05:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-29T09:10:37.143Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-comment/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

